﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Xml.Linq;
using System.Diagnostics;
using System.Configuration;

namespace YLClient.Froms
{
    /// <summary>
    /// Interaction logic for SettingManager.xaml
    /// </summary>
    public partial class SettingManager : Window
    {
        public SettingManager()
        {
            InitializeComponent();
            initialUi();
        }

        private void initialUi()
        {
            txtItemSaveDir.Text = Config.ClientConfig.WorkItemSaveDir;
            txtbLoginName.Text = Config.ClientConfig.AutoLoginName;
            txtbPwd.Text = Config.ClientConfig.AutoLoginPwd;
        }

        private void btnSetting_Click(object sender, RoutedEventArgs e)
        {
            Config.ClientConfig.WorkItemSaveDir = txtItemSaveDir.Text;
            Config.ClientConfig.AutoLoginName = txtbLoginName.Text;
            Config.ClientConfig.AutoLoginPwd = txtbPwd.Text;
            Config.ClientConfig.Save();
            this.Close();
        }
    }
}
